<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="java.util.List"%>
<%@page import="com.yaodian100.ec.member.entity.ViewWishList"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<c-rt:set var="imgDomain"><%=ServerValue.getImgDomain()%></c-rt:set>
<html>
<head>
<link rel="stylesheet" href="/css/table_sorter.css" type="text/css" id="" media="print, projection, screen" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<script language="javascript">
$().ready(function(){
	$("#m_commenthistory").css("font-weight","bold");
	$(":input[name*='commentStParam']").change(function(){
		location.href='<c-rt:url value="/member/mycomment/commentHistory.do"/>?p=1&commentStParam='+$("#commentStParam").val();
	});
	<c-rt:if test="${not empty commentStParam}">
		$("#commentStParam").val("${commentStParam}");
	</c-rt:if>
});
</script>
</head>
<body>
 <!-- content start -->
    <div class="content">
    <h2>购买评价</h2>
	    <c:if test="${msg == 'success'}">
	    <div class="conversion-notice"><b></b>您的评价已提交成功，待评价通过审核后会在相关商品页显示。<a href="#" title="" onclick="$(this).parent().hide()">&nbsp;</a></div>
	    </c:if>
	    <c:if test="${msg != 'success' && not empty msg}">
	    <div class="conversion-notice suspend"><b></b>
	    	<c-rt:choose>
	    		<c-rt:when test="${'already.comment' eq msg}">很抱歉，此笔商品已评价，无法重覆评价。</c-rt:when>
	    		<c-rt:when test="${'orderSt.notCorrect' eq msg}">很抱歉，此笔商品的订单状态不正确，无法评价。</c-rt:when>
	    		<c-rt:when test="${'member.notCorrect' eq msg}">很抱歉，您的会员资料异常，无法评价。</c-rt:when>
	    		<c-rt:when test="${'orderDetail.notCorrect' eq msg}">很抱歉，此笔订单已超过期限，无法评价。</c-rt:when>
	    		<c-rt:otherwise>${msg}</c-rt:otherwise>
	    	</c-rt:choose>
	    	<a href="#" title="" onclick="$(this).parent().hide()">&nbsp;</a>
	    </div></c:if>
    <div class="mb-show">
      <ul class="mb-tab">
            <li><a href="${frontContextPath}/member/mycomment/mycomment.do?p=1">可评价的商品(${htmlContent.commentListSize})</a></li>
            <li class="mb-tab-f"><a href="${frontContextPath}/member/mycomment/commentHistory.do?p=1">已发表的评价(${htmlContent.totalCount})</a></li>
		  </ul><div class="a-function"><a href="#comment-rule">了解具体评价规则</a></div>
		   <c:if test="${htmlContent.totalCount == 0 && commentStParam == ''}">
		       <div class="no-cmt-table">
		           <div style="background-position:0 -295px;width:220px">
		            <span class="txt-m">您目前还没有评价任何商品！</span><br />
		            <span class="txt-s">赶快去评价商品吧，还有积分可拿...</span>
		           </div>
		       </div>
       </c:if>
			 <c:if test="${htmlContent.totalCount == 0 && not empty commentStParam}">
				<table class="tb-2 cmt-table cmt-history">
        <thead>
          <tr>
            <th width="75">商品图片</th>
            <th width="140">商品信息</th>
            <th>评价内容</th>
            <th width="75">评价时间</th>
            <th width="120">
            <s:select label="评价状态" id="commentStParam" name="commentStParam" headerKey="" headerValue="不限"
		list="approveStMenu.options" listKey="key" listValue="value.name" />
            </th>
          </tr>
        </thead>
				<tbody>
          <tr>
            <td colspan="5"><p style="text-align:center">无相关评价商品</p></td>
          </tr>
        </tbody>
        </table>
			 </c:if>
       <c:if test="${htmlContent.totalCount > 0}">
	   <table class="tb-2 cmt-table cmt-history">
        <thead>
          <tr>
            <th width="75">商品图片</th>
            <th width="140">商品信息</th>
            <th>评价内容</th>
            <th width="75">评价时间</th>
            <th width="120">
            <s:select label="评价状态" id="commentStParam" name="commentStParam" headerKey="" headerValue="不限"
		list="approveStMenu.options" listKey="key" listValue="value.name" />
            </th>
          </tr>
        </thead>
        <tbody>
         <c-rt:forEach items="${htmlContent.commentHistoryList}" var="orderComment" varStatus="presentIndex">
          <tr>
            <td>
            <img src="${imgDomain}/PImg/${pu:substring(orderComment.productId, 0,4) }/${orderComment.productId}/${orderComment.productId}_m75.jpg" alt="" width="75" height="75"  onError="this.src='/PImg/blank_75.gif'" />
            </td>
            <td valign="top"><p><a href="/ecmall/product/product.do?productId=${orderComment.mainProductId}" target="_blank">${orderComment.productName}</a><br />${orderComment.specName}</p></td>
            <td valign="top"><p><strong>${orderComment.subject}</strong><dfn class="s-box star-${orderComment.score}-0"><span class="sr1"></span><span class="sr2"></span><span class="sr3"></span><span class="sr4"></span><span class="sr5"></span></dfn></p>
            <p class="cmt-content">${orderComment.content}</p></td>
            <td>
            <fmt:formatDate value="${orderComment.createDate}" pattern="yyyy-MM-dd" />
            </td>
            <td>
            <c:if test="${!(orderComment.commentStatus=='80' && orderComment.failCount<=1)}">
            ${approveStMenu.options[orderComment.commentStatus].name}<br />
            </c:if>
            <c:if test="${orderComment.commentStatus=='80' && orderComment.failCount<=1}">
            <dfn class="crm-rule" onmouseout="$(this).toggleClass('touched')" onmouseover="$(this).toggleClass('touched')"><span>${approveStMenu.options[orderComment.commentStatus].name}</span><b><sup></sup>请针对商品样式与质量提出原创的，对其他用户有参考价值的评价。</b></dfn><br />
            </c:if>
            <c:if test="${orderComment.commentStatus=='00' || orderComment.commentStatus=='80' && orderComment.failCount<=1}">
            <a href="/ecmall/member/mycomment/editcomment.do?orderComtCmid=${orderComment.cmid}">修改评价</a>
            </c:if>
            <c:if test="${orderComment.commentStatus=='90' && orderComment.bonus > 0}">
            	<span class="type-7">${orderComment.bonus}积分</span>
            </c:if>
            </td>
          </tr>
         </c-rt:forEach>   
        </tbody>
      </table>
      
	      <p class="page-change">
			<c:choose>
	         <c:when test="${htmlContent.totalPage==1 || htmlContent.currentPage==1}">
				<span class="a-no">&lt; 上一页</span> |
			 </c:when>
			<c:otherwise>
				<c:if test="${htmlContent.orderType!='HSP'}">	
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}" class="a-togo">&lt; 上一页</a> |
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}&s=${htmlContent.selectparm}" class="a-togo">&lt; 上一页</a> |
				</c:if>
			</c:otherwise>
			</c:choose>		
			<c:forEach begin="${htmlContent.startPage}" end="${htmlContent.endPage}" var="i">
				<c:choose>
					<c:when test="${htmlContent.currentPage==i}">
						<b class="pg-now">${i}</b>
					</c:when>
					<c:otherwise>
							<a href="${link}?t=${htmlContent.orderType}&p=${i}">${i}</a>
					</c:otherwise>
				</c:choose>
			</c:forEach>
			<c:choose>
			<c:when test="${htmlContent.currentPage == htmlContent.totalPage}">
				<span class="a-no"> | 下一页 &gt;</span>
			</c:when>
			<c:otherwise>
				<c:if test="${htmlContent.orderType!='HSP'}">	
				 | <a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}" class="a-togo">下一页 &gt;</a>
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">
				 | <a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}&s=${htmlContent.selectparm}" class="a-togo">下一页 &gt;</a>
				</c:if>
			</c:otherwise>
			</c:choose>
		 </p>
	</c:if>
          <p align="right"><a href="#"><span class="a-top"></span>Top</a></p>
          <a name="comment-rule" id="comment-rule"></a>
          <!-- 注意事项 -->
          <div class="txt-note">
              <strong>评价规则：</strong>
              <ol class="list-num">
                <li>只能对在半年内购买的商品进行评价，评价通过审核后可在商品页显示并且获得积分，赠品可以评价但不送积分。</li>
                <li>同一订单或相隔15日内订单中相同商品的相同属性，只有一次评价可以获得积分。</li>
                <li>若审核不通过，可在30天内修改一次评价后重新审核。</li>
                <li>评价后15分钟内可修改，逾时则不能修改。</li>
                <li>欢迎您发表有价值的评价，拷贝他人内容、内容重复，过多标点符号等情况很难通过审核。</li>
              </ol>
          </div>
          <!-- 注意事项 -->
        </div>
      <!-- 內容 -->
      <!-- 內容 -->
    </div>
    <!-- content end -->


</body>
</html>